<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['供应链管理','生产采购管理','委外加工申请']" icon="fa fa-cogs"
			class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>

	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>委外加工申请</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 220px);">
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time"
											id="datetimepicker1" autocomplete="off" placeholder="选择交货开始时间" />
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time"
											id="datetimepicker2" autocomplete="off" placeholder="选择交货结束时间" />
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
								</div>
								<div class="top_module cancle">
									<span class="module_text">供应商</span>
									<input type="text"
										class="module_inp top_module_select ng-pristine ng-valid ng-touched"
										placeholder="供应商" [(ngModel)]='tableSearch.supplierName '>
									<div class="s_del_icon" (click)='delKey("supplierName")'>x</div>
								</div>
								<div class="top_module cancle">
									<span class="module_text">物料编码</span>
									<input type="text"
										class="module_inp top_module_select ng-pristine ng-valid ng-touched"
										placeholder="物料编码" [(ngModel)]='tableSearch.materialNumber '>
									<div class="s_del_icon" (click)='delKey("materialNumber")'>x</div>
								</div>
								<div class="top_module cancle">
									<span class="module_text">物料名称</span>
									<input type="text"
										class="module_inp top_module_select ng-pristine ng-valid ng-touched"
										placeholder="物料名称" [(ngModel)]='tableSearch.materialName '>
									<div class="s_del_icon" (click)='delKey("materialName")'>x</div>
								</div>

								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="new_outsourceProcessing()"
									*ngIf="addPermission">添加</button>
								<button type="button" class="btn btn-primary" (click)="dataExceport()">导出</button>
							</div>
						</div>
						<div class="table_scroll">
							<table
								class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>供应商</th>
										<th>交货日期</th>
										<th>物料编码</th>
										<th>物料名称</th>
										<th>规格型号</th>
										<th>数量</th>
										<th>单位</th>
										<th>创建时间</th>
										<th>创建人</th>
										<th>更新时间</th>
										<th>更新人</th>
										<th *ngIf="editPermission||delPermission">操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i">
										<td>{{row.supplierName}}</td>
										<td>{{row.deliveryDate}}</td>
										<td>{{row.materialNumber}}</td>
										<td>{{row.materialName}}</td>
										<td>{{row.specification}}</td>
										<td>{{row.count}}</td>
										<td>{{row.units}}</td>
										<td>{{row.createTime}}</td>
										<td>{{row.createName}}</td>
										<td>{{row.updateTime}}</td>
										<td>{{row.updateName}}</td>
										<td>
											<button type="button"
												(click)="updata_outsourceProcessing(row,IncomingInspectReportModal)"
												*ngIf="editPermission">编辑</button>
											<button type="button" (click)="deleteRow(row)"
												*ngIf="delPermission">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i
									class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>

	<!--    弹窗-->
	<section bsModal #IncomingInspectReportModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
		aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="modalClose(IncomingInspectReportModal)"
						aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">委外加工申请 - <span>编辑</span></h4>
				</div>
				<form id="IncomingInspectReportForm" class="form-horizontal" role="form" novalidate="novalidate"
					[saBootstrapValidator]="validatorOptions">
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">供应商<sup>*</sup></label>
								<div class="col-xs-10 insert_text">
									<input class="form-control" [(ngModel)]='IncomingInspectReportForm.supplierName'
										name='supplierName' />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">交货日期<sup>*</sup></label>
								<div class="col-xs-10 insert_text">
									<input class="form-control" id="deliveryDateAdd"
										[(ngModel)]='IncomingInspectReportForm.deliveryDate' name='deliveryDate' />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">物料编码<sup>*</sup></label>
								<div class="col-xs-10 insert_text">
									<input class="form-control" [(ngModel)]='IncomingInspectReportForm.materialNumber'
										name='materialNumber' />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">物料名称<sup>*</sup></label>
								<div class="col-xs-10 insert_text">
									<input class="form-control" [(ngModel)]='IncomingInspectReportForm.materialName'
										name='materialName' />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">规格型号<sup>*</sup></label>
								<div class="col-xs-10 insert_text">
									<input class="form-control" [(ngModel)]='IncomingInspectReportForm.specification'
										name='specification' />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">数量<sup>*</sup></label>
								<div class="col-xs-10 insert_text">
									<input class="form-control" [(ngModel)]='IncomingInspectReportForm.count'
										name='count' onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">单位<sup>*</sup></label>
								<div class="col-xs-10 insert_text">
									<input class="form-control" [(ngModel)]='IncomingInspectReportForm.units'
										name='units' />
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default"
							(click)="modalClose(IncomingInspectReportModal)">取消</button>
						<button type="button" class="btn btn-primary"
							(click)="apiControlSubmit(IncomingInspectReportModal)">确认</button>
					</div>
				</form>
			</div>
		</div>
	</section>
	<!--  弹窗end-->
</div>
<style>
	.cancle {
		position: relative;
	}

	.cancle:hover>.s_del_icon {
		display: inline-block;
	}
</style>